<?php
if($access_control != "924y39c9vns8r73"){ header("location:../"); }
echo "<script>bg_menu('m_caixa');</script>\n";
include_once "controle/conta.php";
?>
<h1>Conta</h1>
<fieldset>
    <legend>Nova conta</legend>
    <form action="" method="post" id="form_filtro_movimento">
        <div>
            <label class="campos"><span>*</span> Descrição: </label>
            <input type='text' value='<?php echo $conta->get_descri(); ?>' name='descri' id='descri'>
            <?php if($msg_erro["descri"] != ''){ echo "<div class='erro'>".$msg_erro["descri"]."</div>";}?>
        </div>
        <br>
        <div>
            <label class="campos"><span>*</span> Tipo de movimento: </label>
            <input type='radio' name='entrada' id='entrada' vlaue='1' <?php if($conta->get_entrada() == 1){ echo "checked='checked'"; } ?>>
            <label for='entrada'>Entrada</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input type='radio' name='entrada' id='saida' value='2' <?php if($conta->get_entrada() == 2){ echo "checked='checked'"; } ?>>
            <label for='saida'>Saída</label>
            <?php if($msg_erro["entrada"] != ''){ echo "<div class='erro'>".$msg_erro["entrada"]."</div>";}?>
        </div>
        <br>
        <div>
            <label class="campos"><span>*</span> Valor: </label>
            <input type='text' value='<?php echo $conta->get_valor(); ?>' name='valor'>
            <?php if($msg_erro["valor"] != ''){ echo "<div class='erro'>".$msg_erro["valor"]."</div>";}?>
        </div>
        <div id="dv_data_vencimento">
            <label class="campos">Data do vencimento: </label>
            <input type='text' value='<?php echo $conta->get_dt_venc(); ?>' name='dt_venc' maxlength="10" OnKeyPress="formatar(this, '00/00/0000')">
            <?php if($msg_erro["dt_venc"] != ''){ echo "<div class='erro'>".$msg_erro["dt_venc"]."</div>";}?>
        </div>
        <br>
        <div>
            <label class="campos"><span>*</span> Pago ou recebido: </label>
            <input type='radio' name='status' id='pago' vlaue='1' <?php if($conta->get_status() == 1){ echo "checked='checked'"; } ?>>
            <label for='pago'>Sim</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input type='radio' name='status' id='npago' value='0' <?php if($conta->get_status() == 0){ echo "checked='checked'"; } ?>>
            <label for='npago'>Não</label>
            <?php if($msg_erro["status"] != ''){ echo "<div class='erro'>".$msg_erro["status"]."</div>";}?>
        </div>
        <br>
        <button type='submit' name='btn_salvar' value='Salvar' class="botao">Salvar</button>
    </form>
</fieldset>
